local bb = require("badboy")
bb.loadutilslib()
init("",1)
local width,height = getScreenSize()

--判断用户当前是否为静止
local screenPoint = {}
function isUnMove()
	keepScreen(true)
	if #screenPoint == 0 then
		for i =0 ,10,1 do 
			local x = math.random(width)
			local y = math.random(height)
			local color = getColor(x,y)
			sysLog("x:"..x.."y:"..y.."color:"..color)
			table.insert(screenPoint,{x,y,color})
		end
	end
	
	local isMove = false
	for v ,s in pairs(screenPoint) do 
		local currentColor = getColor(s[1],s[2]);
		sysLog("currentColor:"..currentColor.."s3:"..s[3])
		if  currentColor~= s[3] then
			keepScreen(false)
			return false;
		end
	end
	keepScreen(false)
	return true
end

while true do 
	mSleep(2000)
	if isUnMove() then
		sysLog("静止")
	end
end